<template>
	<view class="detail">
		<view class="detail_con">
			<view class="detail_banner">
				<image src="../../static/second_banner.png" mode="widthFix"></image>
			</view>
			<view class="detail_head">
				<image :src="host + detail.avatar" class="detail_head_img"></image>
				<view class="detail_head_con">
					<view class="detail_head_title">{{detail.name}}</view>
					<view class="detail_head_address">
						<image src="../../static/address.png"></image>
						<text>{{detail.address}}</text>
					</view>
					<view class="detail_head_phone">
						<image src="../../static/phone.png"></image>
						<text>{{detail.manage_name}}</text>
						<text style="margin-left: 10rpx;">{{detail.phone}}</text>
						<!-- <text style="margin-left: 10rpx;">{{detail.email}}</text> -->
					</view>
				</view>
			</view>
			<view class="detail_back">
				<view @click="back">返回</view>
				<text>品牌详情</text>
			</view>
			<view class="detail_content" v-html="detail.content">
				<!-- <image src="../../static/index_banner.jpg" mode="widthFix" v-for="item in 10"></image> -->
			</view>
		</view>
		<image src="../../static/top.png" class="back_top" @click="backTop"></image>
	</view>
</template>

<script>
	import network from "../../utils/network.js"
	import config from "../../config.js"
	export default {
		data() {
			return {
				id:'',
				host: config.host,
				detail: {}
			}
		},
		onLoad(options) {
			this.id = options.id
			this.getDetail()
		},
		methods: {
			getDetail(){
				network.get('/index/api/getCompanyInfo',{companyId:this.id}, res=>{
					console.log(res)
					this.detail = res.data
				})
			},
			back(){
				const pages = getCurrentPages()
				if(pages.length > 1){
					uni.navigateBack()
				}else{
					uni.navigateTo({
						url: `../second/second?id=${this.detail.category_id}&name=${this.detail.category_name}`
					})
				}
			},
			backTop(){
				uni.pageScrollTo({
					scrollTop: 0
				})
			}
		}
	}
</script>

<style scoped>
.detail{
	max-width: 750px;
	margin: 0 auto;
	min-height: calc(100vh - 75rpx);
	padding-bottom: 75rpx;
	background: #f2ede1;
	position: relative;
}
.detail_con{
	min-height: calc(100vh - 200rpx);
	padding-bottom: 125rpx;
	background: #f2ede1 url(../../static/bottom_bg.png) no-repeat center bottom;
	background-size: 264rpx 93rpx;
}
.detail_banner{
	/* height: 164rpx; */
	
}
.detail_banner image{
	width: 100%;
	height: auto;
	display: block;
}
.detail_head{
	background-color: #00692D;
	color: #FFF;
	display: flex;
	padding: 35rpx 35rpx 45rpx 34rpx;
}
.detail_head_img{
	flex-shrink: 0;
	width: 161rpx;
	height: 161rpx;
	margin-right: 55rpx;
	border-radius: 24rpx;
}
.detail_head_title{
	font-size: 42rpx;
	font-weight: 600;
}
.detail_head_address{
	display: flex;
	align-items: center;
	font-size: 14px;
	margin-top: 20rpx;
}
.detail_head_address image{
	width: 18rpx;
	height: 24rpx;
	flex-shrink: 0;
	margin-right: 14rpx;
}
.detail_head_phone{
	display: flex;
	align-items: center;
	font-size: 14px;
	margin-top: 24rpx;
}
.detail_head_phone image {
	width: 21rpx;
	height: 21rpx;
	flex-shrink: 0;
	margin-right: 14rpx;
}

.detail_back{
	background-color: #007532;
	color: #FFF;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 24rpx 35rpx;
}
.detail_back view{
	width: 132rpx;
	background-color: #60C070;
	height: 60rpx;
	border-radius: 30rpx;
	text-align: center;
	line-height: 60rpx;
}
.detail_content image,.detail_content >>> img{
	display: block;
	width: 100% !important;
}
.back_top{
	width: 48rpx;
	height: 48rpx;
	position: absolute;
	right: 20rpx;
	bottom: 40rpx;
}
</style>
